//
//  TTItem.m
//  Tint
//
//  Created by Kevin Wu on 2/22/12.
//  Copyright (c) 2012 Telligenty. All rights reserved.
//

#import "TTItem.h"


@implementation TTItem


#pragma mark - Accessors

@synthesize title = _title;
@synthesize image = _image;


#pragma mark - Memory

- (id)initWithTitle:(NSString *)title image:(UIImage *)image
{
    self = [super init];
    if ( self ) {
        TTCopy(title, _title);
        TTRetain(image, _image);
    }
    return self;
}

- (void)dealloc
{
    TTRelease(_title);
    TTRelease(_image);
    [super dealloc];
}



#pragma mark - Public

+ (TTItem *)itemWithTitle:(NSString *)title
{
    return [self itemWithTitle:title image:nil];
}

+ (TTItem *)itemWithImage:(UIImage *)image
{
    return [self itemWithTitle:nil image:image];
}

+ (TTItem *)itemWithTitle:(NSString *)title image:(UIImage *)image
{
    return [[[self alloc] initWithTitle:title image:image] autorelease]; // AUTO
}

@end
